Colors {
    Colors.black = rgba(0.0, 0.0, 0.0, 1.0)
    Colors.gray = rgba(0.8, 0.8, 0.8, 1.0)
    Colors.darkgray = rgba(0.6, 0.6, 0.6, 1.0)
    Colors.red = rgba(1.0, 0.0, 0.0, 1.0)
    Colors.yellow = rgba(1.0, 1.0, 0.0, 1.0)
    Colors.orange = rgba(1.0, 0.6, 0.0, 1.0)
    Colors.lightorange = rgba(1.0, 0.6, 0.0, 0.25)
    Colors.green = rgba(0.0, 1.0, 0.0, 1.0)
    Colors.blue = rgba(0.0, 0.0, 1.0, 1.0)
    Colors.lightblue = rgba(0.0, 0.0, 1.0, 0.25)
    Colors.cyan = rgba(0.0, 1.0, 1.0, 1.0)
    Colors.purple = rgba(0.5, 0.0, 0.5, 1.0)
    Colors.white = rgba(1.0, 1.0, 1.0, 1.0)
    Colors.none = rgba(0.0, 0.0, 0.0, 0.0)
    Colors.lightblue2 = rgba(0.82, 0.88, 0.94, 1.0)
}

global {
       global.pi_over_four = 0.78
       global.half_pi = 1.57
       global.pi = 3.14
       global.two_pi = 6.28
}

Point p {
      p.shape = CircleTransform {
      	      x = 0.0
	      y = 0.0
	      r = 10.0
	      color = Colors.blue
	      strokeWidth = 0.0
      }
}

Set X {
    X.dx = OPTIMIZED -- Seems wrong with only this
    X.dy = OPTIMIZED
    X.angle = OPTIMIZED

    X.shape = LineTransform {
    	-- TODO: This shouldn't be a DOF when not set. Otherwise it might result in a shear when we don't rotate about the origin.
        -- startX = 0.0
	-- startY = 0.0
	-- endX = -200.0
	-- endY = 100.0

        startX = -100.0
	startY = 0.0
	endX = 100.0
	endY = 0.0

	-- TODO: should be able to set these to optimized
    	dx = X.dx
	dy = X.dy
	scaleX = 1.0 -- This distorts the arrowhead
	scaleY = 1.0
	rotation = X.angle
	thickness = 8.0

	leftArrowhead = True
	rightArrowhead = True

	-- transform = translate(X.dx, X.dy)
	strokeWidth = 0.0
	color = setOpacity(Colors.yellow, 0.5)
    }
}

Set `B` {
    -- `B`.shape.startX = 0.0
    -- `B`.shape.startY = 0.0
    -- `B`.shape.endX = 100.0
    -- `B`.shape.endY = 100.0

    override `B`.shape.leftArrowhead = False
    override `B`.shape.color = setOpacity(Colors.green, 0.5)
}

Set `A`; Set `B` {
   LOCAL.objFn = encourage boundaryIntersect(`A`.shape, `B`.shape)
   -- LOCAL.objFn = encourage containsPoly(`A`.shape, `B`.shape)
}
